home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1999 July / Macworld (1999-07).dmg / Shareware World / Graphics / Popup Xtra 3.2 / POPUP.X32 / TEXT / TEXT_CASTSCRIPT next >
Text File  |  1999-03-18  |  2KB  |  47 lines

  1. ---------------------------------------------------
  2. -------------- on menuItemSelected ----------------
  3. ---------------------------------------------------
  4.  
  5. -- The Popup Xtra castmember will send the "menuItemSelected" event to Director
  6. -- whenever a valid menu selection has been made.
  7. --
  8. -- The menuItemSelected event is sent when one of the following occurs:
  9. -- (1) The user clicks the mouse on the Popup Xtra sprite, selects an item and
  10. --    then releases the mouse button (and the trapEvents property has been set to TRUE
  11. --    either through scripting or the Castmember Properties dialog), or
  12. -- (2) The Activate() command has been explicitly called and the user selects an item and
  13. --    then releases the mouse button.
  14. --
  15. -- NOTE: If you are using the activateMenu command, *always* set the trapsEvents property
  16. -- to FALSE, which can be done in the Castmember Properties dialog or through scripting.
  17. -- This will allow your scripting to control the appearance of the menu and not Director.
  18.  
  19. -- Arguments:
  20. -- me:         the Popup Xtra sprite that was used to make the selection
  21. -- menuSpec:   the selected item's menu specification (the selectedSpec property)
  22. -- menuText:   the selected item's text (the selectedText property)
  23. -- memberRef:  the Popup Xtra castmember that was used to make the selection
  24.  
  25. on menuItemSelected me, menuSpec, menuText, memberRef
  26.   -- your Lingo code goes here
  27. end
  28.  
  29.  
  30. -- TIPS:
  31.  
  32. -- The menuItemSelected event sent first to the sprite. If no sprite script or behavior
  33. -- is attached which processes this event, then the event is sent to this castmember script.
  34. -- The order of calling this handler is as follows:
  35. -- Sprite script-->Cast script-->Frame script-->Movie Script
  36.  
  37. -- So, if you want to have the same Popup Xtra castmember used for numerous sprites, you
  38. -- need to add this event handler to the sprite script (the castmember handler will never get
  39. -- called if there is a sprite script event handler for the menuItemSelected event.)
  40.  
  41. -- If you want to have a movie handler control *all* of the Popup Xtra interactions, you can
  42. -- comment out the menuItemSelected handler from all of the castmember scripts and add one to
  43. -- the movie script instead. You can then examine the memberRef argument to determine which
  44. -- menu was selected.
  45.  
  46.  
  47.